<?php 
require_once ROOT_PATH . '/lib/models/hrfunct/EmpInfo.php';
require_once ROOT_PATH . '/lib/models/skillmatrix/SkillUser.php';
require_once ROOT_PATH . '/lib/models/hrfunct/EmpLang.php';
require_once ROOT_PATH . '/lib/models/eimadmin/LanguageInfo.php';
//require_once ROOT_PATH . '/lib/models/skillmatrix/SkillExpertise.php';
require_once ROOT_PATH . '/lib/models/skillmatrix/SkillGroup.php';
$empList = EmpInfo::getEmpSkillInfo();
$baseURL = './CentralController.php?skillMatrixcode=SkillMatrix';
$lanlist = LanguageInfo::getLang();
$grdcodes = array("Poor"=> 1 ,"Average"=>2 , "Good"=>3 ,"Excellent"=>4);
$name=array_keys($grdcodes);
$code=array_values($grdcodes);
?>
<script type="text/javascript">
 function returnExport() {
		
		document.standardView.action = '<?php echo $baseURL;?>&action=ExportTechnical';
		document.standardView.submit();
}

function returnSearch() {
		document.standardView.action = '<?php echo $baseURL;?>&action=Individual';
		document.standardView.submit();
}

</script>
 
<h2><?php echo "STAFF TECHNICAL SUMMARY"; ?><hr/></h2>
<form id="standardView" name="standardView" method="post" action="<?php echo $baseURL;?>&action=Summary">
<div style="padding: 6px;" class="buttons">
	<a href="#" class="button" value="Export" onclick="returnExport(); return false;">Export</a>					
</div>

<table border="0" cellpadding="0" cellspacing="0" width="700">
   <thead>
  	<tr>
		<th class="tableTopLeft"></th>    	
    	<th class="tableTopMiddle" ></th>
    	<th class="tableTopMiddle" ></th>
    	<th class="tableTopMiddle" ></th>
    	<th class="tableTopMiddle" ></th>
    	<th class="tableTopMiddle" ></th>
    	<th class="tableTopMiddle" ></th>
    	<th class="tableTopMiddle" ></th>
    	<th class="tableTopMiddle" ></th>
		<th class="tableTopRight"></th>
	</tr>
	
	<tr>
		<th class="tableMiddleLeft"></th>	
		<th class="tableMiddleMiddle"  >#</th>	
    	<th class="tableMiddleMiddle"  id="individualName">Name</th>
    	<th class="tableMiddleMiddle" id="individualPosition"  >Position</th>
    	<th class="tableMiddleMiddle"  ># Year of experience</th>
    	<th class="tableMiddleMiddle"   >Foreign language</th>
    	<th class="tableMiddleMiddle"  >Foreign language Level</th>
    	<th class="tableMiddleMiddle"   >Work abroad</th>
    	<th class="tableMiddleMiddle"  >Expertise</th>
		<th class="tableMiddleRight"></th>
	</tr>
  </thead>
  <tbody>
 <?php for($i=0;$i<count($empList);$i++){ ?>
 	<?php $i%2?$cssClass='odd':$cssClass='even'; ?> 	
 	<?php $employee = $empList[$i]; ?>
 	<?php $skillIndividual = SkillIndividual::getSkillIndividualByUser($employee[0]); ?>
 	<?php $emplan = EmpLanguage::getAssEmpLang($employee[0]);		 ?>
	<tr >
  	<td class="tableMiddleLeft"></td>
  	<td class="<?php echo $cssClass; ?>"><?php echo $i+1; ?></td>
  	<td class="<?php echo $cssClass; ?>" style="font-weight:bold;">
  		<?php echo $employee[1]." ".$employee[4]." ".$employee[3]; ?>
  	</td>
  	<td class="<?php echo $cssClass; ?>">
  		<?php echo $employee[7]; ?>  	
  	</td>
  	<td align="center" class="<?php echo $cssClass; ?>">
  		<?php echo $skillIndividual->getSkillIndividualNumOfYear(); ?>
  	</td>
  	<td style="padding:0px;" class="<?php echo $cssClass; ?>">
  		<table cellpadding="0" cellspacing="0">
  			<?php for($j=0;$j<count($emplan);$j++){ ?>
	  		<tr>
	  			<td>
	  				<?php $lname=""; ?>
	  				<?php for($a=0;count($lanlist)>$a;$a++){ ?>							
						<?php if($emplan[$j][1] == $lanlist[$a][0]){?>
							<?php $lname=$lanlist[$a][1];  ?>
						<?php } ?>							
					<?php } ?>
					<?php echo $lname; ?>		
	  			</td>
	  		</tr>
	  		<?php } ?>
  		</table>
  	</td>
  	<td style="padding:0px;" class="<?php echo $cssClass; ?>">
  		<table cellpadding="0" cellspacing="0">
  		<?php for($j=0;$j<count($emplan);$j++){ ?>
	  		<tr>
	  			<td>
	  				<?php $rate=""; ?>
	  				<?php for($b=0;count($grdcodes)>$b;$b++){ ?>							
						<?php if($emplan[$j][3] == $code[$b]){?>
							<?php $rate=$name[$b];  ?>
						<?php } ?>							
					<?php } ?>
					<?php echo $rate; ?>		
	  			</td>
	  		</tr>
	  	<?php } ?>
	  	</table>	
  	</td>
  	<td class="<?php echo $cssClass; ?>" >
  		<?php echo $skillIndividual->getSkillIndividualWorkAbroad(); ?>
  	</td>
  	<td class="<?php echo $cssClass; ?>">
  		<?php echo $skillIndividual->getSkillIndividualExpertise(); ?>
  	</td>
  	<td class="tableMiddleRight"></td>
  </tr> 
 <?php } ?>
  </tbody>
 
  <tfoot>
  	<tr>
		<td class="tableBottomLeft"></td>
		<td class="tableBottomMiddle"></td>
		<td class="tableBottomMiddle"></td>
		<td class="tableBottomMiddle"></td>
		<td class="tableBottomMiddle"></td>
		<td class="tableBottomMiddle"></td>
		<td class="tableBottomMiddle"></td>
		<td class="tableBottomMiddle"></td>
		<td class="tableBottomMiddle"></td>
		<td class="tableBottomRight"></td>
	</tr>
  </tfoot>
  
</table>

